<?php

/**
 * 用户登录 小挂件
 */
class LoginWidget extends CWidget{
    public $divId;
    public $rule;   //是否可以操作这个区块
    public $path;
    public $isRefresh;
    public $adminPath;
    public $logout = 0;  //logout状态  默认是本页面翻转 0    1为跳回首页
    public $alert = 'left';
    public function init(){
        $assets = Yii::getPathOfAlias('application').DIRECTORY_SEPARATOR.'widgets'.DIRECTORY_SEPARATOR.'login'.DIRECTORY_SEPARATOR.'statics'.DIRECTORY_SEPARATOR;
        //静态文件夹
        $this->path = Yii::app()->getAssetManager()->publish($assets, false, -1, YII_DEBUG);//强制生成
        //$this->path = Yii::app()->assetManager->publish($assets);
    }
    public function run(){
        Yii::app()->clientScript->registerCssFile($this->path . "/css/jquery.ui.css");
        Yii::app()->clientScript->registerCssFile($this->path . "/css/animate.css");//旋转效果
        Yii::app()->clientScript->registerCssFile($this->path . "/css/login.css");
        Yii::app()->clientScript->registerScriptFile($this->path . '/js/animate-fix.js',CClientScript::POS_END);

        $this->render('login',array('alert'=>$this->alert,'path'=>$this->path,'divId'=>$this->divId,'logout'=>$this->logout));
    }


}